package Libs.Componentes.Visuais
{
	import flash.display.DisplayObject;
	import mx.controls.Image;
	import mx.controls.TextInput;
	import mx.core.mx_internal;
	
	public class MyImageNumericInput extends NumericInput
	{
		private var _image:Image;
	    public var icon:String;
	    
		public function MyImageNumericInput()
		{
			 super();
		}
		
		 override protected function createChildren():void
	    {
	        super.createChildren();
	
	        _image = new Image();
	        _image.source = icon;
	
	        addChild(DisplayObject(_image));
	    }
	
	    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
	    {
	        super.updateDisplayList(unscaledWidth, unscaledHeight);
	
	        this._image.width = 11;
	        this._image.height = 12;
	
	        this._image.x = this.width - this._image.width - 4;
	        this._image.y = this.height/2 - this._image.height/2;
	
	        this.textField.width = this.width - this._image.width - 5;
	    }
	}
}